package com.sunxu.designpatterns.patterns.creational.singleton;

/**
 * @author 孙许
 * @date 2018-08-22
 * @description 懒汉式，延迟加载，线程不安全
 */
public class LazySingleton {
    private static LazySingleton lazySingleton;

    private LazySingleton() {

    }

    public synchronized static LazySingleton getInstance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
